<template>
	<view>
		<view class="" v-if="Object.keys(items).length > 0">
			<video :poster="items.video_cover_img" :src="items.video_link" v-if="items.video_link != ''" style="width:100%"></video>
		</view>
		<view class="" style="display: flex;justify-content: space-between;padding: 20rpx;font-size: 32rpx;align-items: center">
			<view class="" style="max-width: 70%;">
				{{items.title}}
			</view>
			<view class="" style="font-size: 28rpx;">
				{{items.createtime}}
			</view>
		</view>
		<view class="wid100 bacFFF poFix" style="bottom: 0;">
			<view class="dis disAl" style="height: 120rpx;">
				<view class="hei80 wid90 mar borRad10 dis disAl disJuC foSi30 coFFF" 
					style="background-color: #035DFF;" @click.stop="show_contacts_ewm()">立即沟通</view>
			</view>
			<!-- <view class="dis disAl" style="height: 120rpx;">
				<view class="hei80 wid90 mar borRad10 dis disAl disJuC foSi30 coFFF" 
					style="background-color: #035DFF;" @click.stop="baoming(items.id,items.companyid)">报名</view>
			</view> -->
			<view v-if="bottomHight != 0" :style="'height: '+(bottomHight - 20)+'px;'"></view>
		</view>
		<view class="" style="padding: 20rpx;">
			<rich-text :nodes="items.content"></rich-text>
		</view>
		<uni-popup ref="popup" type="bottom" border-radius="10px 10px 0 0">
			<view class="" style="background-color: #fff;padding: 30rpx;border-radius: 15rpx;align-items: center;display: flex;flex-direction: column;">
				<image :src="url+items.contacts_ewm" mode="" style="width: 400rpx;height: 400rpx;"></image>
				<view class="" style="margin-top:20rpx;color: #565656;">
					长按图片保存
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import { Train } from '../../model/training-model.js';
	
	var Trains = new Train();
	import { Config } from '../../utils/config.js';
	export default {
		data() {
			return {
				url: Config.restUrl,
				items:{}
			}
		},
		onLoad(option) {
			console.log(option)
			this.getdata(option.id)
		},
		methods: {
			show_contacts_ewm(){
				// 提示二维码
				this.$refs.popup.open('center')
			},
			getdata(id){
				var that = this
				let params = {
					id:id
				}
				Trains.Details((data) => {
					console.log(data)
					if (data.code === 1) {
						that.items = data.data
					} else {
						uni.showToast({
							title: data.msg,
							icon: 'none',
							duration: 2000
						})
					}
				}, params)
			}
		}
	}
</script>

<style>
page{
	background-color: #fff;
}
</style>
